package com.jztchat.asyncTask.chatRecordTask;

import com.jztchat.entity.ChatRecord;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * Created by zzy on 2018/1/19.
 */
@Component
@Slf4j
public class RecordChatHandler implements InitializingBean {

    public static final Queue<ChatRecord> queue = new ConcurrentLinkedQueue<>();

    @Override
    public void afterPropertiesSet() throws Exception {
        log.info("开启监控聊天记录---初始化---");
        new Thread(new RecordChatTask()).start();//开启监控聊天记录
    }
}


